package com.deli.mapper;

import com.deli.entity.TestUserList;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.LinkedHashMap;
import java.util.List;

@Repository(value = "testUserListMapper")
public interface TestUserListMapper {

    List<LinkedHashMap<String, Object>> getStatusAndTestTypeByNameAndPhone(@Param(value = "userName") String userName,
                                                                           @Param(value = "phoneNum") String phoneNum);

    Integer updateStatusByUserNameAndPhoneNum(@Param(value = "userName") String userName,
                                              @Param(value = "phoneNum") String phoneNum,
                                              @Param(value = "testType") Integer testType,
                                              @Param(value = "status") int status);

    Integer addUser(TestUserList testUserList);

    List<LinkedHashMap<String, Object>> getAllNameAndPhone();

    List<LinkedHashMap<String, Object>> getStatusAndTestTypeByNameAndPhoneAndTestType(@Param(value = "userName") String userName,
                                                                                      @Param(value = "phoneNum") String phoneNum,
                                                                                      @Param(value = "testType") Integer testType);

    List<LinkedHashMap<String,Object>> getList(@Param(value = "userName") String userName,
                                               @Param(value = "mobilePhone") String mobilePhone,
                                               @Param(value = "departmentname") String departmentname,
                                               @Param(value = "testType") Integer testType,
                                               @Param(value = "userPosition") String userPosition,
                                               @Param(value = "textfield") String textfield,
                                               @Param(value = "pageNum") Integer pageNum);

    Integer getUserCount();

    int selectByNameAndPhoneAndTesttypeWithStatus(@Param(value = "userName") String userName,
                                                  @Param(value = "mobilePhone") String mobilePhone,
                                                  @Param(value = "testType") Integer testType);

    Integer checkRepeat(TestUserList testUserList);
}
